<!DOCTYPE html>
<html>
  <head>
    <title>{{ title| default:"AnsibleUI" }}</title>
    <link rel="shortcut icon" href="/static/favicon.ico" />
    <!-- 引入css 和 js 文件 -->
    <link rel="stylesheet" href="/static/bootstrap/bootstrap.min.css" />
    <link rel="stylesheet" href="/static/bootstrap/bootstrap-theme.min.css" />
    <script src="/static/js/jquery-3.4.1.min.js"></script>
    <script src="/static/bootstrap/bootstrap.min.js"></script>
    <!-- 定义了 body 和 myleft 的样式 -->
    <style type="text/css">
      body {
        background-color: #fbfeff; /* 背景颜色 */
        background-repeat: no-repeat;
        background-attachment: fixed;
        padding-top: 70px;  /* 设置上内边距 */
      }
      .myleft {
        z-index: 9999; /* 最前端 */
        position: fixed !important; /* 绝对位置 */
        left: 0px; /* 位置最左边 */
        top: 49px; /* 上边框距离顶端 49 像素 */
        height: 100%; /* 高度 */
        width: 180px; /* 宽度 180 像素 */
        border-right: 1px solid #8080801f; /* 边框 */
      }
    </style>
  </head>

  <body>
    <!-- 页面顶部的一个导航条 -->
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <a class="navbar-brand" href="/ansible/">AnsibleUI</a>
        <ul class="nav navbar-nav navbar-right">
          <a class="navbar-brand" href="/admin">后台管理</a>
          {% if request.user.is_authenticated %}
          <li class="dropdown">
            <a
              href="#"
              class="dropdown-toggle"
              data-toggle="dropdown"
              role="button"
              aria-haspopup="true"
              aria-expanded="false"
              >{{ user.first_name }}({{ user }})&nbsp;&nbsp;<span
                class="caret"
              ></span
            ></a>
            <ul class="dropdown-menu">
              <li><a href="/account/changepwd">修改密码</a></li>
              <li role="separator" class="divider"></li>
              <li>
                <a href="#" data-toggle="modal" data-target="#myModal"
                  ><d>设置邮箱</d></a
                >
              </li>
              <li role="separator" class="divider"></li>
              <li><a href="/account/usersetting">用户页面</a></li>
            </ul>
          </li>
          &nbsp&nbsp
          <a class="navbar-brand" href="/account/logout">注销</a>
          {% else %}
          <a class="navbar-brand" href="/account/login">登录</a>
        </ul>
        {% endif %}
      </div>
    </nav>
    <!-- 页面左边设置一个功能栏 -->
    <div class="myleft">
      <br />
      <ul class="list-group">
        <li class="list-group-item"><a href="/ansible/">首页</a></li>
        <li class="list-group-item">
          <a href="/ansible/dashboard">统计信息</a>
        </li>
      </ul>
      <ul class="list-group">
        <li class="list-group-item">
          <a href="/ansible/get_groups">查看组</a>
        </li>
        <li class="list-group-item">
          <a href="/ansible/get_hosts">查看主机</a>
        </li>
        <li class="list-group-item">
          <a href="/ansible/get_funcs">查看功能</a>
        </li>
      </ul>
      <ul class="list-group">
        <li class="list-group-item">
          <a href="/ansible/get_Ansible_Tasks">查看任务</a>
        </li>
        <li class="list-group-item">
          <a href="/ansible/push_task">执行任务</a>
        </li>
        <li class="list-group-item">
          <a href="/ansible/push_playbook">执行Playbook</a>
        </li>
      </ul>
    </div>
    <!-- 剩余空间的内容，block 内部为默认，其他页面引入该文件时，可定义 blcok  content 替换该内容 -->
    <div class="container-fluid" style="margin-left: 180px;">
      {% block content %}
      <h3 style="text-align: center">Ansible 操作控制平台</h3>
      <div class="line"></div>
      <div class="col-md-6">
        <div id="main" style="height:400px;border: 1px solid gray;"></div>
      </div>
      <div class="col-md-6">
        <div id="main2" style="height:400px;border: 1px solid gray;"></div>
      </div>
      {% endblock %}
    </div>
  </body>
</html>